home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksimpleconfig.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.6 KB  |  82 lines

  1. /* This file is part of the KDE libraries
  2.    Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org)
  3.    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
  4.  
  5.    This library is free software; you can redistribute it and/or
  6.    modify it under the terms of the GNU Library General Public
  7.    License as published by the Free Software Foundation; either
  8.    version 2 of the License, or (at your option) any later version.
  9.  
  10.    This library is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    Library General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU Library General Public License
  16.    along with this library; see the file COPYING.LIB.  If not, write to
  17.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.    Boston, MA 02110-1301, USA.
  19. */
  20.  
  21. #ifndef _KSIMPLECONFIG_H
  22. #define _KSIMPLECONFIG_H
  23.  
  24. #include "kconfig.h"
  25.  
  26. class KSimpleConfigPrivate;
  27.  
  28. /**
  29.  * KDE Configuration entries
  30.  *
  31.  * This is a trivial extension of KConfig for applications that need
  32.  * only one configuration file and no default system.
  33.  * A difference with KConfig is that when the data in memory is written back
  34.  * it is not merged with what is on disk.
  35.  * Whatever is in memory simply replaces what is on disk entirely.
  36.  *
  37.  * @author Kalle Dalheimer <kalle@kde.org>, Preston Brown <pbrown@kde.org>
  38.  * @see KConfigBase KConfig
  39.  * @short KDE Configuration Management class with deletion ability
  40.  */
  41. class KDECORE_EXPORT KSimpleConfig : public KConfig
  42. {
  43.   Q_OBJECT
  44.  
  45. public:
  46.   /**
  47.    * Construct a KSimpleConfig object and make it either read-write
  48.    * or read-only.
  49.    *
  50.    * @param fileName The file used for saving the config data. Either
  51.    *                  a full path can be specified or just the filename.
  52.    *                  If only a filename is specified, the default
  53.    *                  directory for "config" files is used.
  54.    * @param bReadOnly Whether the object should be read-only.
  55.    */
  56.   KSimpleConfig( const QString &fileName, bool bReadOnly = false);
  57.  
  58.   KSimpleConfig(KConfigBackEnd *backEnd, bool bReadOnly = false);
  59.  
  60.   /**
  61.    * Destructor.
  62.    *
  63.    * Writes back any dirty configuration entries.
  64.    */
  65.   virtual ~KSimpleConfig();
  66.  
  67.   virtual void sync();
  68.  
  69. private:
  70.  
  71.   // copy-construction and assignment are not allowed
  72.   KSimpleConfig( const KSimpleConfig& );
  73.   KSimpleConfig& operator= ( const KSimpleConfig& rConfig );
  74.  
  75. protected:
  76.   virtual void virtual_hook( int id, void* data );
  77. private:
  78.   KSimpleConfigPrivate *d;
  79. };
  80.  
  81. #endif
  82.